Skip to content

CBL-8390: Support comparing and continuing from a non-numeric checkpoint#2499

Merged
jianminzhao merged 1 commit into
release/3.4from
cbl-8390
Jun 6, 2026
Merged

CBL-8390: Support comparing and continuing from a non-numeric checkpoint#2499
jianminzhao merged 1 commit into
release/3.4from
cbl-8390

Conversation

@jianminzhao

Copy link
Copy Markdown
Contributor

Also updated tools module to release/3.4

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

This is a release branch and commits are restricted.

Please confirm this PR is one of the following:

  • A response to a customer ask
  • A change per our security policy
  • A non-functional change (i.e. changes needed for building an older version)
  • A change that has been granted an exception (please comment)

@cbl-bot

cbl-bot commented Jun 6, 2026

Copy link
Copy Markdown

Code Coverage Results:

Type Percentage
branches 64.55
functions 77.39
instantiations 70.97
lines 75.97
regions 72.22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the replicator checkpoint reconciliation logic to support Sync Gateway-style compound (non-numeric) sequence IDs, so LiteCore can compare remote checkpoint values instead of always resetting when they aren’t plain integers.

Changes:

  • Added ParsedSequenceID to parse/compare SG compound sequence formats (simple, backfill, lowSeq).
  • Enhanced RemoteSequence and Checkpoint::validateWith to compare parseable compound checkpoints and only reset when sequences are truly unparseable.
  • Added comprehensive unit tests for parsing/comparison rules and integrated them into CMake and Xcode project targets.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Xcode/LiteCore.xcodeproj/project.pbxproj Adds new replicator header and test source to Xcode project/test targets.
Replicator/tests/ParsedSequenceIDTest.cc New tests covering parsing and ordering (including quoted JSON-string cases).
Replicator/RemoteSequence.hh Adds conversion helper to parse/normalize remote sequences into ParsedSequenceID.
Replicator/ParsedSequenceID.hh New parsing + ordering implementation for compound SG sequence IDs.
Replicator/Checkpoint.cc Uses parsed ordering to decide rollback/ignore behavior for mismatched remote sequences.
LiteCore/tests/CMakeLists.txt Includes the new test file in the CMake-based test target.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +262 to +265
// Rule: simple.seq < backfill.triggeredBy (strict <)
// A plain seq N sorts BEFORE a backfill triggered at N,
// meaning "N" < "N:M" for any M.

@jianminzhao jianminzhao merged commit 07c3bc7 into release/3.4 Jun 6, 2026
11 checks passed
@jianminzhao jianminzhao deleted the cbl-8390 branch June 6, 2026 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants